package com.vst.orm.search.flex;

import java.util.List;

import com.vst.orm.search.Field;
import com.vst.orm.search.Filter;
import com.vst.orm.search.ISearch;
import com.vst.orm.search.Sort;

public class FlexSearchWrapper implements ISearch {
	FlexSearch search;

	public FlexSearchWrapper(FlexSearch flexSearch) {
		this.search = flexSearch;
	}

	public List<String> getFetches() {
		return this.search.fetches;
	}

	public List<Field> getFields() {
		return this.search.fields;
	}

	public List<Filter> getFilters() {
		return this.search.filters;
	}

	public int getFirstResult() {
		return this.search.firstResult;
	}

	public int getMaxResults() {
		return this.search.maxResults;
	}

	public int getPage() {
		return this.search.page;
	}

	public int getResultMode() {
		return this.search.resultMode;
	}

	public Class<?> getSearchClass() {
		if ((this.search.searchClassName == null) || ("".equals(this.search.searchClassName))) {
			return null;
		}
		try {
			return Class.forName(this.search.searchClassName);
		} catch (ClassNotFoundException e) {
			throw new RuntimeException(e);
		}
	}

	public List<Sort> getSorts() {
		return this.search.sorts;
	}

	public boolean isDisjunction() {
		return this.search.disjunction;
	}

	public boolean isDistinct() {
		return this.search.distinct;
	}
}
